home *** CD-ROM | disk | FTP | other *** search
- head 1.2;
- branch ;
- access ;
- symbols ;
- locks jhh:1.2; strict;
- comment @ * @;
-
-
- 1.2
- date 88.08.08.13.25.04; author ouster; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 88.06.30.11.06.30; author ouster; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.2
- log
- @Documentation was wrong.
- @
- text
- @/*
- * Host_ByID.c --
- *
- * Source code for the Host_ByID library procedure.
- *
- * Copyright 1988 Regents of the University of California
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- */
-
- #ifndef lint
- static char rcsid[] = "$Header: Host_ByID.c,v 1.1 88/06/30 11:06:30 ouster Exp $ SPRITE (Berkeley)";
- #endif not lint
-
- #include <stdio.h>
- #include <host.h>
- #include <hostInt.h>
-
-
- /*
- *-----------------------------------------------------------------------
- *
- * Host_ByID --
- *
- * Return info about a host based on its Sprite ID.
- *
- * Results:
- * A pointer to a Host_Entry structure, or NULL if no machine
- * with that ID exists. The Host_Entry is statically allocated,
- * and may be modified on the next call to any Host_ procedure.
- *
- * Side Effects:
- * The host database is opened if it wasn't already so.
- *
- *-----------------------------------------------------------------------
- */
- Host_Entry *
- Host_ByID(id)
- register int id; /* ID of machine to find */
- {
- register Host_Entry *entry; /* Current entry in database */
-
- if (Host_Start() != 0) {
- return (Host_Entry *) NULL;
- }
-
- while (1) {
- entry = Host_Next();
- if (entry == (Host_Entry *) NULL) {
- return entry;
- } else if (entry->id == id) {
- return (entry);
- }
- }
- }
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
- d33 3
- a35 3
- * A Host_Entry structure the caller must free or NULL, if no machine
- * with that ID exists. The Host_Entry is statically allocated, and
- * may be modified on the next call to any Host_ procedure.
- @
-